 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace DomainModel.Entities
{
//company table

    public class Company
    {

        [KeyAttribute]
        [HiddenInput(DisplayValue = false)]        
        public int CompanyId { get; set; }

        [HiddenInput(DisplayValue = false)]
        public DateTime? LastUpdate { get; set; }

        [HiddenInput(DisplayValue = false)]        
        public bool IsApproved { get; set; }

        [HiddenInput(DisplayValue = false)]  
        public string UserName { get; set; }

        [StringLength(500, ErrorMessage = "The Name value cannot exceed 500 characters. ")]
        [Required(ErrorMessage = "Name is required field.")]
        [Display(Name = "Name")]
        public string Name { get; set; }

        [StringLength(500, ErrorMessage = "يمكن أن تكون القيمة اسم لا يتجاوز 500 حرفا ")]
        [Required(ErrorMessage = "مطلوب اسم الحقل")]
        [Display(Name = "الاسم في اللغة العربية")]
        public string Name_Ar { get; set; }

        [StringLength(250, ErrorMessage = "The Phone value cannot exceed 250 characters. ")]
        [Required(ErrorMessage = "Phone is required field.")]
        [Display(Name = "Phone")]
        public string Phone { get; set; }

        [Display(Name = "Address")]
        public string Address { get; set; }

        [Display(Name = "عنوان باللغة العربية")]
        public string Address_Ar { get; set; }

        [StringLength(50, ErrorMessage = "The Email value cannot exceed 50 characters. ")]
        [RegularExpression(@"^([\w-_]+\.)*[\w-_]+@([\w-_]+\.)*[\w-_]+\.[\w-_]+$", ErrorMessage = "Please give correct email address")]
        [Required(ErrorMessage = "Email is required field.")]
        [Display(Name = "Email")]
        public string Email { get; set; }

        [Display(Name = "Website")]
        public string Website { get; set; }

        [Display(Name = "Company Type")]
        [HiddenInput(DisplayValue = false)]
        public int TypeId { get; set; }

        [ForeignKey("TypeId")]
        public virtual CompanyType CompanyType { get; set; }
    }
}
